<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        /* html{
            height: 100%;
        } */
        body{
            height: 100%;
            width: 100%;
            background-image: url(./images/189279.jpg);
            background-repeat: no-repeat;
            background-size: 100%;
        }
        a{
            text-decoration: none;
            color: inherit;
        }
        .box{
            height: 520px;
            width: 400px;
            background-color: white;
            margin: 30px auto;
        }
        .title{
            width: 338px;
            margin: 0 auto;
            padding: 30px;
            text-align: center;
        }
        .text{
            width: 338px;
            height: 46px;
            margin: 0 auto;
            position: relative;
        }
        .shuru{
            width: 100%;
            height: 100%;
            padding: 0 40px 0 33px;
        }
        .password{
            width: 338px;
            height: 46px;
            margin: 20px auto;
            position: relative;
        }
        .pwd{
            width: 100%;
            height: 100%;
            padding: 0 40px 0 30px;
        }
        .ico-user{
            width: 24px;
            height: 22px;
            position: absolute;
            display: block;
            top: 10px;
            left: 10px;
        }
        .ico-pass{
            width: 24px;
            height: 22px;
            position: absolute;
            display: block;
            top: 10px;
            left: 10px;
        }
        .com{
            position: absolute;
            top: 12px;
            right: 8px;
            color: gray;
        }
        .question{
            display: flex;
            justify-content: space-between;
            padding: 29px;
        }
        .options{
            flex: 1;
            display: flex;
            align-items: center;
        }
        .forget{
            text-align: center;
        }
        .login{
            height: 46px;
            width: 338px;
            text-align: center;
            line-height: 46px;
            background-color: skyblue;
            font-size: 18px;
            font-weight: 600;
            margin: 0 auto;
        }
        .register{
            height: 46px;
            width: 338px;
            margin: 0 auto;
            text-align: center;
            line-height: 46px;
        }
        .register a{
            color: skyblue;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="title">
            <h2>邮箱账号登录</h2>
        </div>
        <div class="text">
            <img class="ico-user" src="./images/ico-user.png" alt="">
            <input id="username" class="shuru" type="text" value="">
            <span class="com">@163.com</span>
        </div>
        <div class="password">
            <img class="ico-pass" src="./images/ico-password.png" alt="">
            <input id="password" class="pwd" type="password" value="" >
        </div>
        <div class="question">
            <div class="options">
                <input type="radio">
                十天内免登录
            </div>
            <div class="forget">
                <a href="">忘记密码？</a>
            </div>
        </div>
        <div class="login">
            <a id="btn" href="">登录</a>
        </div>
        <div class="register">
            <a href="">新用户注册</a>
        </div>
    </div>
</body >
<script>
// 获取每个元素 注册事件
var userName = document.getElementById('username');
var passWord = document.getElementById('password');
var btn = document.getElementById('btn');
// 注册点击事件
btn.onclick = function(){
    // alert('你成功了')
    // 记住 == 的功能 自动将数据转换成相同的类型来判断 
    //    === 比较严谨,会判断数据的值与类型是否相同 成功就是true 失败就是false
    if(userName.value == "李二先生" && passWord.value == "123456"){
        alert('登录成功');
    }else{
        alert('登录失败');
    }
}

</script>
</html>